<template>
	<view class="content">

		<view class="item-view" v-for="(item,index) in listMessage" :key="index">

			<view class="item-top">
				<text class="item-title">{{item.title}}</text>

			</view>

			<view class="item-bottom">
				<text class="item-contenttext">{{item.content}}</text>
				<text class="item-datetext">{{item.startTime}}</text>
			</view>


		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listMessage: []
			}
		},
		onLoad() {
			this.requestData()
		},
		onPullDownRefresh() {
			this.requestData()
		},
		methods: {
			requestData() {
				this.$u.get('/client/notices/list', {}).then(res => {
					this.listMessage = res.list;
					uni.stopPullDownRefresh();
				});

			}

		}
	}
</script>

<style lang="scss">
	page {
		background-color: $uni-bg-color-grey;
	}

	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.item-view {
		display: flex;
		flex-direction: column;
		padding: 25rpx;
		justify-content: center;
		width: 94%;
		background-color: $uni-bg-color;
		border-radius: 12rpx;
		margin-top: 20rpx;

		.item-top {
			padding-bottom: 20rpx;
			border-bottom: #eeeeee solid 1rpx;

			.item-title {

				font-size: 15px;
				color: $uni-text-color;
			}
		}

		.item-bottom {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;
			margin-top: 20rpx;

			.item-contenttext {
				font-size: 14px;

				color: $uni-text-color;
				padding-bottom: 15rpx;
			}

			.item-datetext {
				width: 100%;
				text-align: center;
				font-size: 12px;
				padding-right: 20rpx;
				color: $uni-text-color-grey;
			}
		}


	}
</style>
